<%--
 *  File:    VisitPlanFeedbackDetail.jsp
 *  @Author: KentZhong 
 *  Date:    2009-10-9 10:02:44
 *
 *  Copyright (C) 2000 - 2009 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>
<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>


<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>


<%

  String strTableName = "";
  String strModuleName = "SFE";
   String privilegeCode = "H0258";
  
	String contextPath = request.getContextPath();
%>

<%@ include file="/inc/PageDefault.inc" %>
<%@ include file="/inc/LocationDefault.inc" %>
<html>
<head>
<title>AgreementMeetDetail</title>

<PageFlow:CheckPageFlow pageName="p_activitymeetdetail"/>
<%


String flag = (String)pageContext.getAttribute("flag");
if(flag == null) flag = new String("");

int nProcessID = -1;
if (pageContext.getAttribute("processid") != null)
	nProcessID = ((Integer)pageContext.getAttribute("processid")).intValue();
   String viewflag = "";

     if(pageContext.getAttribute("viewflag") != null&&((String)pageContext.getAttribute("viewflag")).equals("view")) {

           viewflag = "view";
     }
%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%=contextPath%>/css/<%= strLanguageCode %>/main.css" type="text/css">
<script type="text/javascript" charset="utf-8" src="<%=contextPath %>/sfehtml/js/jquery-1.8.0.min.js"></script>
<script src="<%=contextPath%>/js/Jquery1.5.2.js"></script>
<script language="JavaScript" src="<%=contextPath%>/css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="<%=contextPath%>/js/ScriptLib.js"></script>
<script language="JavaScript" src="<%=contextPath%>/js/FuncLib.js"></script>
<script language="JavaScript" src="<%=contextPath%>/js/Calendar.js"></script>
<style type="text/css">
 #contenttype_1 {
  width: 72px;
 }
 #contenttype_2 {
  width: 163px;
 }
 #contenttype_3 {
  width: 72px;
 }
 #contenttype_4 {
  width: 72px;
 }
 #contenttype_5 {
  width: 72px;
 }
 #contenttype_6 {
  width: 163px;
 }
 #contenttype_8 {
  width: 280px;
 }
</style>
<%@ include file="/inc/NewCalendar.inc" %>

<script language="JavaScript">
function page_close()
{
	window.close();
}

function page_setfileid(num,id)
{
	var myform = eval("document.cform");
	var fileobj=eval("myform.detailattrachid"+num);
			
	if(!isEmpty(id))
	{
		fileobj.value=id;
	}
	else
	{
		fileobj.value=" ";
	}
}

function page_closedetail()
{
	var myform = eval("document.cform");
	myform.actionname.value = "close";
 	myform.target="_self";
 	isRunning = true;
 	myform.submit();
}

function page_confirm(num)
{
	var t = null;
  if(top.topFrame != null)
    t = top.topFrame;
  if(t == null && opener != null && opener.top != null && opener.top.topFrame != null)
    t = opener.top.topFrame;
  if(t == null && opener != null && opener.opener != null && opener.opener.top != null && opener.opener.top.topFrame != null)
    t = opener.opener.top.topFrame;
  if(t != null)
    message = t.message;
  else
    message = new ActiveXObject("Scripting.Dictionary");
    
	var myform = eval("document.cform");
 /* myform.starttime.value=myform.planvisitdate.value+" "	+"1:00:00";
	myform.endtime.value=myform.planvisitdate.value+" "	+"23:59:00";*/
	
	for(i=0;i<Number(myform.numrows.value);i++)
	{
		var attrname=eval("myform.attrname"+i);
		var objtext=eval("myform.detailtext"+i);
		if(objtext!=null&& !isEmpty(objtext.value)) 
		{
		  if(objtext.value.length >200 ) 
		  {
			  alert(attrname.value+"<%=message.getMessageDesc("Input_Long")%>");
				return;
			}
		}
			
		var objnumber=eval("myform.detailnumber"+i);

		if(objnumber!=null && !isNumeric(objnumber.value))
		{
			//alert(replaceString(message.Item("VALUE_MUST_BE_NUMBER"),"%s",attrname.value.replace("\'","'")));
			alert(replaceString("<%=message.getMessageDesc("VALUE_MUST_BE_NUMBER")%>","%s",attrname.value.replace("\'","'")));
			return;
		}
				
	  if(i<num)
	  {
			if(objnumber!=null && isEmpty(objnumber.value))
			{
				//alert(replaceString(message.Item("VALUE_NOT_NULL"),"%s",attrname.value.replace("\'","'")));
				alert(replaceString("<%=message.getMessageDesc("VALUE_NOT_NULL")%>","%s",attrname.value.replace("\'","'")));
				return;
			}

			//if(objtext!=null && isEmpty(objtext.value))
			//{
			//	alert(replaceString(message.Item("VALUE_NOT_NULL"),"%s",attrname.value.replace("\'","'")));
			//	return;
			//}
					
			var objselected=eval("myform.detailselect"+i);
			if(objselected!=null && isEmpty(objselected.value))
			{
				//alert(replaceString(message.Item("VALUE_NOT_NULL"),"%s",attrname.value.replace("\'","'")));
				alert(replaceString("<%=message.getMessageDesc("VALUE_NOT_NULL")%>","%s",attrname.value.replace("\'","'")));
				return;
			}

			//alert();
			var objattrach=eval("myform.detailattrachid"+i);
			if(objattrach!=null && isEmpty(objattrach.value))
			{
				//alert(replaceString(message.Item("VALUE_NOT_NULL"),"%s",attrname.value.replace("\'","'")));
				alert(replaceString("<%=message.getMessageDesc("VALUE_NOT_NULL")%>","%s",attrname.value.replace("\'","'")));
				return;
			}		

			//alert(1);	
			if (myform.globalpccode.value == 112)
	    {						
		  
		    var objactionname = eval("myform.actionname"+i);

			  if(objactionname != null && objactionname.value == '10340-100001220')
			  {
				  var objprice=eval("myform.detailnumber"+i);
				  if(objprice.value <15 || objprice.value >30)
				  {
					  alert("<%= message.getMessageDesc("RetailPrice_Must_Between_15_and_30")%>");
					  return;
				  }
				}

			  if(objactionname != null && objactionname.value == '10341-100001220')
			  {								
				  var objdate=eval("myform.znovadetaildate"+i);
				  var Nowdate = new Date(); 
				  var nowyear = Nowdate.getYear();
				  var nowmonth = Nowdate.getMonth()+1;
				  var nowday = Nowdate.getDate(); 
				  var Nowdatestr = nowyear +'-'+nowmonth+'-'+nowday;
				  var oDate1= new Date(Date.parse(objdate.value.replace(/-/g,   "/")));   
				  var oDate2= new Date(Date.parse(Nowdatestr.replace(/-/g,   "/")));   								
				  if(oDate1 > oDate2)
				  {
				    alert("<%= message.getMessageDesc("proddate_error")%>");
				  	return;
				  }	
		  	}
			}						
		}
		var objscheck=eval("myform.sdetailcheck"+i);
		var objcheck=eval("myform.detailcheck"+i);
		if(objscheck!=null && objscheck.checked)
		{
			objcheck.value="Y";
		}
		else if(objscheck!=null && !objscheck.checked)
		{
			objcheck.value="N";
		}			
	}
	emptyToNull(cform);
	myform.actionname.value = "save";
	myform.target="_self";
	isRunning = true;
	myform.submit();
}
function page_selectProd(){
	var url = "<%=contextPath%>/zmyl/agreement/AgreementProductSelect.jsp?zmylagreementid="+document.cform.zmylagreementid.value+"&multirowflag=Y"+"&<%= OvalTools.randomURL()%>";
	var windowAttribute = "height=500, width=600,top=100,left=100, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=yes";
  	if(popwindow!=null) popwindow.close();
  	popwindow = window.open(url,null,windowAttribute);
}
function page_setproduct(id,umcode,prodcode,prodname){
	var frm = document.cform;
	frm.uprodid.value = id;
	frm.prodcode.value = prodcode;
	frm.prodname.value = prodname;
}
function page_add()
{
    var myform = eval("document.cform");
    var objscheck=eval("myform.sdetailcheck");
	var objcheck=eval("myform.detailcheck");
	if(objscheck!=null && objscheck.checked)
	{
		objcheck.value="Y";
	}
	else if(objscheck!=null && !objscheck.checked)
	{
		objcheck.value="N";
	}			
    if(!checkForm(document.cform))return;
  	cform.actionname.value = "add";
  	cform.target = "_self";
  	isRunning = true;
  	cform.submit();

}
function clearCheckFlag(obj){
	if(!obj.checked){
		cform.checkallbox.checked=false;
	}
}
function clickCheckBox(obj){
	if(cform.numrows.value == 0){
		cform.selectedids.checked=obj.checked;
	}else if(cform.numrows.value >= 1){
		var j=0;
		for(var i=0;i<Number(cform.numrows.value-1);i++){
			var idchk=document.getElementById('serialno'+j);
			if(idchk){
				idchk.checked=obj.checked;
			}
			j++;
		}
	}
}
 function setSelectValues(obja,objb) {
    var str="";
    $("input[name='"+obja+"']:checkbox").each(function(){ 
        if($(this).attr("checked")){
            str += $(this).val()+","
        }
    })
    //alert(str);
    str.split(",");
    //alert(str[0]);
    if (str.length > 0) {
        str = str.substring(0, str.length - 1);
    }else{
     str=" ";
    }
    $("input[name='"+objb+"']").attr("value",str);
    //alert($("input[name='"+objb+"']").val());
}
</script>
</head>
<body>
	<form name="cform" method="post" action="<%=contextPath%>/Dispatcher">
    <input type="hidden" name="pagename" value="p_activitymeetdetail">
    <input type="hidden" name="actionname">
    <custom:hidden property="activitymanageid"/>
    <custom:hidden property="globalpccode"/>
    <table width="100%" cellspacing="0" border="0" cellpadding="0" id="vtable">          
       <%
        int numfrist=0;
        //配置项
        Vector vSKUProcessDetails=(Vector)pageContext.getAttribute("basedetails");
         if(vSKUProcessDetails==null)
           vSKUProcessDetails=new Vector();
        //out.print(vSKUProcessDetails);
        HashMap detailinfo=(HashMap)pageContext.getAttribute("activitymanageinfo");
       	if(detailinfo==null) detailinfo=new HashMap();
        Integer oStatus=(Integer)detailinfo.get("status");
         
       	if(oStatus!=null && oStatus.intValue()==99)
       		pageContext.setAttribute("displayflag","view");
			Date dActualStart=(Date)detailinfo.get("starttime");
			Date dActualEnd=(Date)detailinfo.get("endtime");
			String sActualStart="";
			String sActualEdit="";
			
	    Vector vAllFiles=(Vector)pageContext.getAttribute("allfiles");
          if(vAllFiles==null) vAllFiles=new Vector();
            HashMap fileInfoMaps=new HashMap();
            for(int i=0;i<	vAllFiles.size();i++)
            {
            	HashMap oneFile=(HashMap)vAllFiles.get(i);
           		Integer oFileID=(Integer)oneFile.get("fileid");
           		if(oFileID!=null)
           		{
           			Vector vFiles=new Vector();
           			if(fileInfoMaps.containsKey(oFileID))
           			{
           				vFiles=(Vector)fileInfoMaps.get(oFileID);
           			}
           			vFiles.add(oneFile);
           			fileInfoMaps.put(oFileID,vFiles);
           		}
            }
            if(!fileInfoMaps.isEmpty())
           	{
           		Iterator iter=fileInfoMaps.keySet().iterator();
           		while(iter.hasNext())
           		{
           		Integer keyFile=(Integer)iter.next();
           		pageContext.setAttribute("file_"+keyFile,fileInfoMaps.get(keyFile));
           		}
           	}
           	fileInfoMaps.clear();
           	fileInfoMaps=null;
           	vAllFiles=null;
           //字典表
           Vector vAllSourceTypes=(Vector)pageContext.getAttribute("allsourcetypes");
           if(vAllSourceTypes==null)
           	vAllSourceTypes=new Vector();
           	HashMap sourceTypeMaps=new HashMap();
           	for(int i=0;i<vAllSourceTypes.size();i++)
           	{
           		HashMap oneSourceTypes=(HashMap)vAllSourceTypes.get(i);
           		String strType=(String)oneSourceTypes.get("type");
           		if(strType!=null)
           		{
           			Vector vType=new Vector();
           			if(sourceTypeMaps.containsKey(strType))
           			{
           				vType=(Vector)sourceTypeMaps.get(strType);
           			}
           			vType.add(oneSourceTypes);
           			sourceTypeMaps.put(strType,vType);
           		}
           	}
           	if(!sourceTypeMaps.isEmpty())
           	{
           		Iterator iter=sourceTypeMaps.keySet().iterator();
           		while(iter.hasNext())
           		{
           		String keyType=(String)iter.next();
           		pageContext.setAttribute("sourcetypes_"+keyType,sourceTypeMaps.get(keyType));
           		}
           	}
           	sourceTypeMaps.clear();
           	sourceTypeMaps=null;
           	vAllSourceTypes=null;
       %>
       <tr>
        <td>
          <table width="100%" border="0" cellspacing="0" id="vtable">
            <tr><td class="summary_top"></td></tr>
            <tr><td ><%=label.getLabelName("L_SKUVisitFeedbackInfo")%><%=label.getLabelName("L_Colon")%></td></tr>
          </table>
        </td>
      </tr> 
      <tr>
        <td>
          <table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center">
          	<tr class="deepblue-left">
          	    <td  class="title_center">
			      <%if(vSKUProcessDetails.size() > 0){ %>
			 	   <input type="checkbox" name="checkallbox" class="checkbox"  onclick="clickCheckBox(this)">
		          <%}else{ %>
				   &nbsp;
			      <%} %>
		        </td>
          		<td class="title_center"><%=label.getLabelName("L_Sequence")%></td>
          	    <%
                 for(int i=0;i<vSKUProcessDetails.size();i++)
                {
            	  HashMap actionMap=(HashMap)vSKUProcessDetails.get(i);
                %>
            	<td class="title_center" id="contenttype_<%=(Integer)((HashMap)vSKUProcessDetails.get(i)).get("contenttype") %>" name="contenttype_<%=(Integer)((HashMap)vSKUProcessDetails.get(i)).get("contenttype") %>"><%=actionMap.get("activitypropertyname")%></td>
                 <%
                }
                %> 
         	 </tr>
         	 <%
         	  int num=0;
         	  int seq=1;
         	  Integer idxnum=new Integer(-1);
         	  Integer zidxnum=new Integer(-1);
              //唯一产品、编号 vSKUProcessDetails
              Vector SerialNoDetail=(Vector)pageContext.getAttribute("serialnodetail");
              if(SerialNoDetail==null) SerialNoDetail=new Vector();
              //值
              Vector ProdDetailValues=(Vector)pageContext.getAttribute("proddetailvalues");
              if(ProdDetailValues==null) ProdDetailValues=new Vector();
              for(int i=0;i<SerialNoDetail.size();i++){
            	  HashMap serialHash=(HashMap)SerialNoDetail.get(i); 
         	 %>
         	 <%-- 展示 --%>
         	 <tr>
         	   <td  class="title_center"><input id="serialno<%=num+1 %>" name="deleteids" type="checkbox" value="<%=JspHelper.filterNull( serialHash.get("serialno") )%>" class="checkbox" onclick="clearCheckFlag(this)"></td>
         	   <td><%=seq%>&nbsp;</td>
               <%
                 for(int j=0;j<vSKUProcessDetails.size();j++){
                	 HashMap skuDetails=(HashMap)vSKUProcessDetails.get(j); 
                	 Integer skudetailtype=(Integer)skuDetails.get("contenttype");
                	 HashMap proddetailHash=null;
                	 for(int k=0;k<ProdDetailValues.size();k++){
                		 
                		 if((((HashMap)ProdDetailValues.get(k)).get("serialno")).equals((Integer)serialHash.get("serialno")) && (((HashMap)ProdDetailValues.get(k)).get("activityconfigdetailid")).equals((Integer)skuDetails.get("activityconfigdetailid"))){
                		   proddetailHash= (HashMap)ProdDetailValues.get(k); 
                		 }
                		 //out.print(proddetailHash);
                	 }
                	 pageContext.setAttribute("detailhash",proddetailHash);
                	 zidxnum=new Integer(num);
               %>
               <input type="hidden" name="serialno<%=num%>" value="<%=serialHash.get("serialno")%>"/>
               <td class="title_center">
                  <custom:hidden property="activitymanageid" colIndex="<%=zidxnum %>"/>
                  <input type="hidden" name="activityconfigdetailid<%=num%>" value="<%=skuDetails.get("activityconfigdetailid")%>"/>
                  <custom:hidden property="activitymanagemeetdetailid" name="detailhash" colIndex="<%=zidxnum %>" />
                  <%if(skudetailtype.intValue()==1){%>
                    <custom:text  property="detailnumber" size="8" colIndex="<%=zidxnum %>" name="detailhash"/>
                  <%}else if(skudetailtype.intValue()==2){%>
                    <custom:textarea   property="detailtext" cols="20" rows="2" colIndex="<%=zidxnum %>" name="detailhash"/>
                  <%}else if(skudetailtype.intValue()==3){
                      String strCheck="";
          			  if("Y".equals(((HashMap)pageContext.getAttribute("detailhash")).get("detailcheck")))
          				 strCheck="checked";%>
                  <input type="checkbox" name="sdetailcheck<%=zidxnum %>" class="normalradio"  value="Y"  <%=strCheck%>/>
                  <custom:hidden  property="detailcheck" colIndex="<%=zidxnum %>" name="detailhash"/>
                  <%}else if(skudetailtype.intValue()==4){
                  String strSourceType=(String)skuDetails.get("sourcetype");
                  strSourceType="sourcetypes_"+strSourceType;%>
                    <custom:select name="detailhash"  property="detailselect"  colIndex="<%=zidxnum %>" optionsName="<%=strSourceType%>" optionValueKey="value" optionInnerTextKey="name"   defaultValueCost=" " defaultValue="--------" />
                  <%}else if(skudetailtype.intValue()==5){%>
                    <custom:hidden  name="detailhash" property="detailattrachid" colIndex="<%=zidxnum %>"/>
                    <custom:hidden  name="detailhash"  property="detailtype"  colIndex="<%=zidxnum%>" value="1"/>
                    <iframe src="/sfe/activity/ActivityManageFileUpload.jsp?activitymanagefilesid=<custom:write   property="detailattrachid" />&detailstatus=<custom:write  name="detailinfo"  property="status" />&&baseorskutype=user&<%= OvalTools.randomURL() %>" width="300" height="50" ></iframe>
                  <%}else if(skudetailtype.intValue()==6){%>
                    <custom:text   name="detailhash" property="detaildate" dataType="date" dataFormatName="dateformat"  size="20" readonly="true" colIndex="<%=zidxnum %>" />
                    <a onclick="javascript:c.show(this,'cform.detaildate<%=zidxnum %>','yyyy-MM-dd');"><custom:button type="3" label="L_Asterisk" imgsrc="Time.gif" border="0"/></a>
                 <%}else if(skudetailtype.intValue()==8){%>
                    <custom:hidden name="detailhash"  property="detailmultiselect" colIndex="<%=zidxnum %>"/>
                      <%
                       String oSourcetype=(String)skuDetails.get("sourcetype");
                      //out.print(pageContext.getAttribute("sourcetypes_"+oSourcetype));
                       Vector sourceVector=(Vector)pageContext.getAttribute("sourcetypes_"+oSourcetype);
                       //out.print(newhash);
                       int vbase=1;
                       for(int aa=0;aa<sourceVector.size();aa++){
                      %><input type="checkbox" name="basevalues_<%=zidxnum %>" id="baseids_<%=String.valueOf((Integer)skuDetails.get("activityconfigdetailid"))+"_"+((HashMap)sourceVector.get(aa)).get("value")+"_"+zidxnum %>" value="<%=((HashMap)sourceVector.get(aa)).get("value") %>" class="normalradio" onclick="setSelectValues('basevalues_<%=zidxnum %>','detailmultiselect<%=zidxnum %>')"/> <%=((HashMap)sourceVector.get(aa)).get("name") %>
                      <% if(vbase %2 ==0 && vbase!=0){ %>
          			      <br>
          			  <%}vbase++; %>
                      <%} %>
                  <% }else{ %>
                    &nbsp;
                  <%}%> 
               </td>
               <% num++;} %>
         	 <%
         	 seq++;} %>
         	 </tr>
         	 <!-- 添加 -->
         	 <%if(!viewflag.equals("view")){%>
         	   <%if(vSKUProcessDetails.size()>0){ %>
                 <%if(oStatus==null || oStatus.intValue()==10){%>
         	 <tr>
               <td>&nbsp;</td>
               <td>&nbsp;</td>
               <%for(int i=0;i<vSKUProcessDetails.size();i++){
            	  idxnum=new Integer(num);
            	  HashMap newhash=(HashMap)vSKUProcessDetails.get(i); 
            	  if(newhash==null) newhash=new HashMap();
            	  String activityconfigdetailid=String.valueOf(((Integer)newhash.get("activityconfigdetailid")));
                  Integer ndetailtype=(Integer)((HashMap)vSKUProcessDetails.get(i)).get("contenttype");
                %>
                 <td class="title_center">
                    <custom:hidden   property="activityconfigdetailid"  colIndex="<%=idxnum %>" value="<%=activityconfigdetailid%>"/>
                    <%if(ndetailtype.intValue()==1){%>
                     <custom:text name="newhash" property="detailnumber" size="8" colIndex="<%=idxnum %>"/>
                    <%}else if(ndetailtype.intValue()==2){%>
          			 <custom:textarea  name="newhash"  property="detailtext" cols="20" rows="2" colIndex="<%=idxnum %>"/>
          		    <%}else if(ndetailtype.intValue()==3){%>
          		     <input type="checkbox" name="detailcheck" class="normalradio" name="newhash" />
          			 <custom:hidden  name="newhash"  property="detailcheck" colIndex="<%=idxnum %>"/>
          			<%}else if(ndetailtype.intValue()==4){
          			    String strSourceType=(String)((HashMap)vSKUProcessDetails.get(i)).get("sourcetype");
          				strSourceType="sourcetypes_"+strSourceType;%>
          			 <custom:select  name="newhash"   property="detailselect"  colIndex="<%=idxnum %>" optionsName="<%=strSourceType%>" optionValueKey="value" optionInnerTextKey="name"   defaultValueCost=" " defaultValue="--------" />
                    <%}else if(ndetailtype.intValue()==5){%>
                      <custom:hidden  name="newhash"  property="detailattrachid" colIndex="<%=idxnum %>"/>
                      <custom:hidden  name="newhash"  property="detailtype"  colIndex="<%=idxnum%>" value="1"/>
          			  <iframe src="/sfe/activity/ActivityManageFileUpload.jsp?activitymanagefilesid=<custom:write  name="newhash"  property="detailattrachid" />&detailstatus=<custom:write  name="detailinfo"  property="status" />&&baseorskutype=user&<%= OvalTools.randomURL() %>" width="300" height="50" ></iframe>
                    <%}else if(ndetailtype.intValue()==6){%>
                      <custom:text name="newhash" property="detaildate" dataType="date" dataFormatName="dateformat"  size="20" readonly="true" colIndex="<%=idxnum %>"/>
                      <a onclick="javascript:c.show(this,'cform.detaildate<%=idxnum %>','yyyy-MM-dd');"><custom:button type="3" label="L_Asterisk" imgsrc="Time.gif" border="0"/></a>
          			<%}else if(ndetailtype.intValue()==8){%>
                    <custom:hidden name="detailhash"  property="detailmultiselect" colIndex="<%=idxnum %>"/>
                      <%
                       String oSourcetype=(String)((HashMap)vSKUProcessDetails.get(i)).get("sourcetype");
                      //out.print(pageContext.getAttribute("sourcetypes_"+oSourcetype));
                       Vector sourceVector=(Vector)pageContext.getAttribute("sourcetypes_"+oSourcetype);
                       //out.print(newhash);
                       int base=1;
                       for(int a=0;a<sourceVector.size();a++){
                      %><input type="checkbox" name="basevalues_<%=idxnum %>" id="baseids_<%=String.valueOf((Integer)newhash.get("activityconfigdetailid"))+"_"+((HashMap)sourceVector.get(a)).get("value") %>" value="<%=((HashMap)sourceVector.get(a)).get("value") %>" class="normalradio" onclick="setSelectValues('basevalues_<%=idxnum %>','detailmultiselect<%=idxnum %>')"/> <%=((HashMap)sourceVector.get(a)).get("name") %>
                          <% if(base %2 ==0 && base!=0){ %>
          			      <br>
          			      <%}base++;%>
                      <%} %>
          			<% }else{ %>
          			  &nbsp;
          			<%}%>
                 </td>
               <% num++;
                 }%> 
      </tr>
             <%}
              }
         	 }%>
           </table>
           <input type="hidden" name="numrows" value="<%=num%>"/>
        </td>
      </tr>
      <tr>
         <td>
      	   <table width="100%" cellspacing="0" cellpadding="0">
              <tr>
            	<td class="summary_top">
             	</td>
              </tr>
            <tr>
              <td class="td_center">
              <%if(!viewflag.equals("view")){%>
                <%if(vSKUProcessDetails.size()>0){ %>
                 <%if(oStatus==null || oStatus.intValue()==10){%>
                    <a onclick='page_add()'><custom:button type="2"	label="L_Add" imgsrc="add_btn.gif" border="0" style="width:60" /></a>
					<a onclick="page_delete()"><custom:button type="2" label="L_Delete" imgsrc="delete_btn.gif" border="0" style="width:60" /></a>
             		<a onclick="page_confirm();"><custom:button type="1" label="L_Save" imgsrc="new.gif" border="0" style="width:60"/></a>
             	 <%}
                } 
              }%>
              </td>
            </tr>
          </table>  
        </td>
      </tr>
    </table>
  </form>             	
</body>
<script>
 function page_delete(){
	if(nullChecked(document.cform.deleteids,"<%=JspHelper.filterNull(SerialNoDetail.size())%>"))
	  {
	    alert("<%= message.getMessageDesc("MUST_SELECT_ONE_RECORD") %>");
	    return;
	  }
	if ( ! confirm("<%= message.getMessageDesc("ARE_YOU_SURE")%>") ) 
	    return;
	    var frm = document.cform;
	    frm.actionname.value = "del";
		frm.target = "_self";
		isRunning = true;
		frm.submit();
}
for(i=0;i<Number(document.cform.numrows.value);i++){
  if($("input[name='detailmultiselect"+i+"']").length>0){//对象存在赋值
    var strq =$("input[name='detailmultiselect"+i+"']").val().split(",");
    if (!isEmpty(strq)) {
      //alert("strq"+i);
      //str = str.substring(0, str.length - 1);
      for(j=0;j<strq.length ;j++){
         var obj =$("input[name='basevalues_"+i+"']");
         $.each(obj,function(n,cobj) { 
           //alert(str[j]);
           //alert(n+" "+strq[j]);
           if(cobj.value==strq[j]){
            $(cobj).attr("checked",'true');
           }
         });
      }
    }
  }
}
//document.getElementById("scrollGDiv").style.width=(screen.availWidth - 30);
//alert(Number(document.getElementsByName("contenttype_2").length*72));
document.getElementById("vtable").style.width=Number(document.getElementsByName("contenttype_1").length*72)+document.getElementsByName("contenttype_2").length*163+document.getElementsByName("contenttype_3").length*72+document.getElementsByName("contenttype_4").length*72+document.getElementsByName("contenttype_5").length*72+document.getElementsByName("contenttype_6").length*163+document.getElementsByName("contenttype_8").length*280+30;
//alert(document.getElementById("vtable").style.width);
</script>
</html>
	
